/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2019
 */

package net.dreamlu.db.repo;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import net.dreamlu.db.po.Resource;
import net.dreamlu.db.po.Role;

/**
 *
 * @author lambert.wang email:lambert.wang(a)crediteyes.com
 * @version 1.0
 * @since 1.0
 */
@Repository
public interface RoleRepository extends JpaRepository<Role, java.lang.Integer>, JpaSpecificationExecutor<Role>{
//	@Query(value = "SELECT tr.* FROM t_admin_role tar JOIN t_role tr ON tar.role_id = tr.id "
//			+ "WHERE tr.status = 1 AND tar.admin_id = ?1", nativeQuery = true)
//	List<Role> findListByAdminId(@Param("adminId") Integer adminId);
//
//	
//
//	@Query(value = "SELECT e.resource_id AS id FROM t_role r LEFT JOIN t_role_resource e ON r.id = e.role_id "
//			+ "WHERE r.id = ?1 AND r.status = 1", nativeQuery = true)
//	List<Integer> selectResourceIdListByRoleId(@Param("id") Integer id);
}
